-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(go/adbc/driver/snowflake): Removing SQL injection to get table name with special character for getObjectsTables #1338
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test to confirm that we've removed the potential for sql injection here?
Added test in C# driver test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding tests for special characters in catalog and schema names too. Also, temporary tables that have a wide range of parametrized tests should help improve reliability.
@@ -828,7 +836,7 @@ func (c *cnxn) GetTableSchema(ctx context.Context, catalog *string, dbSchema *st | |||
if dbSchema != nil { | |||
tblParts = append(tblParts, strconv.Quote(strings.ToUpper(*dbSchema))) | |||
} | |||
tblParts = append(tblParts, strconv.Quote(strings.ToUpper(tableName))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should string.ToUpper
conversion be avoided for catalog and schema name too?
This all LGTM, I second @ryan-syed's comments for adding some tests for special characters and avoiding the |
Implemented on top of #1352 (perf(go/adbc/driver/snowflake): Reduced SQL calls in GetObjects to two, added prefixing DbName for INFORMATION_SCHEMA) |
@AnithaPanduranganMS do you mind rebasing? |
…_getobjects_double_quoted_identifier
Description:
Solution:
Testing:
Fixes #1225